<?xml version="1.0" encoding="utf-8"?>
<openerp>
	<data>
		<record id="view_currency_inflation_tree" model="ir.ui.view">
            <field name="name">view.currency.inflation.tree</field>
            <field name="model">currency.inflation</field>
            <field name="arch" type="xml">
            	<tree string="Currency Inflation" colors="blue:state == 'draft';black:state == 'posted'">
            		<field name="journal_account"/>
            		<field name="journal_account_amount"/>
		            <field name="date_prev"/>
		            <field name="exrate_prev"/>
		            <field name="date_curr"/>
		            <field name="exrate_curr"/>
		            <field name="state"/>
            	</tree>
	        </field>
       </record>
	
		<record id="view_currency_inflation_form" model="ir.ui.view">
			<field name="name">view.currency.inflation.form</field>
			<field name="model">currency.inflation</field>
			<field name="type">form</field>
			<field name="arch" type="xml">
				<form string="Currency Inflation">
					<header>
						<button name="approve_curr_inflation" attrs="{'invisible': [('state','in',['posted','cancelled'])]}" string="Post" type="object" default_focus="1" icon="terp-camera_test" class="oe_highlight"/>
						<button name="unapprove_curr_inflation" attrs="{'invisible': [('state','in',['draft','cancelled',False])]}" string="Unposted" type="object"/>
						<button name="set_to_draft" attrs="{'invisible': [('state','in',['draft','posted',False])]}" string="Set to Draft" type="object"/>
						<field name="state" widget="statusbar" statusbar_visible="draft,posted,cancelled" statusbar_colors='{"draft":"blue","posted":"blue","cancelled":"red"}'/>
					</header>
					<sheet>
						<h1 attrs="{'invisible':['|',('state','in',['draft',False]),('name','=','/')]}" modifiers="{'invisible':['|',('state','in',['draft',False]),('name','=','/')]}">
							<field name="name"/>
						</h1>
						<group>
							<group>
								<field name="journal_account" required="1" domain="[('type','in',['bank','cash'])]" attrs="{'readonly': [('state', 'in', ['posted','cancelled'])]}" string="Journal"/>
								<field name="date_prev" required="1" attrs="{'readonly': [('state', 'in', ['posted','cancelled'])]}"/>
								<field name="date_curr" required="1" attrs="{'readonly': [('state', 'in', ['posted','cancelled'])]}"/>
								<!-- <field name="default_account" readonly="1"/> -->
							</group>
							<group>
								<field name="journal_account_amount" required="1" attrs="{'readonly': [('state', 'in', ['posted','cancelled'])]}"/>
								<field name="exrate_prev" required="1" attrs="{'readonly': [('state', 'in', ['posted','cancelled'])]}"/>
								<field name="exrate_curr" required="1" attrs="{'readonly': [('state', 'in', ['posted','cancelled'])]}"/>
							</group>
						</group>
						<notebook>
	                         <page string="Journal Items" attrs="{'invisible': [('state','!=','posted')]}">
	                            <field name="move_ids" readonly="1">
	                               <tree string="Journal Items">
	                                   <field name="move_id"/>
	                                   <field name="ref"/>
	                                   <field name="date"/>
	                                   <field name="statement_id"/>
	                                   <field name="partner_id"/>
	                                   <field name="account_id"/>
	                                   <field name="name"/>
	                                   <field name="debit"/>
	                                   <field name="credit"/>
	                                   <field name="state"/>
	                                   <field name="reconcile_id"/>
	                               </tree>
	                            </field>
	                        </page>
	                    </notebook>
					</sheet>
				</form>
			</field>
		</record>
		
		<record id="currency_inflation_search" model="ir.ui.view">
            <field name="name">currency.inflation.search</field>
            <field name="model">currency.inflation</field>
            <field name="arch" type="xml">
                <search string="Search Currency Inflation">
                   	<field name="journal_account"/>
                </search>
            </field>
       </record>
		
		<record id="action_currency_inflation" model="ir.actions.act_window">
			<field name="name">Currency Inflation</field>
			<field name="type">ir.actions.act_window</field>
			<field name="res_model">currency.inflation</field>
			<field name="view_mode">tree,form</field>
			<field name="search_view_id" ref="currency_inflation_search"/>
			<field name="help">This menu for record currency inflation</field>
		</record>
		
		<record id="action_currency_inflation_tree_bf" model="ir.actions.act_window.view">
			<field name="view_mode">tree</field>
			<field name="view_id" ref="view_currency_inflation_tree"/>
			<field eval="1" name="sequence"/>
			<field name="act_window_id" ref="action_currency_inflation"/>
		</record>

		<record id="action_gate_pass_form" model="ir.actions.act_window.view">
			<field name="view_mode">form</field>
			<field name="view_id" ref="view_currency_inflation_form"/>
			<field eval="2" name="sequence"/>
			<field name="act_window_id" ref="action_currency_inflation"/>
		</record>
		
		<menuitem
            icon="STOCK_JUSTIFY_FILL"
            action="action_currency_inflation"
            id="menu_currency_inflation"
            parent="account.menu_finance_entries"
            sequence="7"/>

	</data>
</openerp>
